package com.example.demo.business.controller.v1;

import com.example.demo.business.bean.vo.IndexCategoryVo;
import com.example.demo.business.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/v1")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
    //获取首页分类
    @GetMapping("/index/category")
    public Object getIndexDate(int type){
        return categoryService.getIndexCategory(type);
    }
    //获取精品分类
    @GetMapping("/best/category")
    public Object getBestCategory(int type){
        return categoryService.getBestCategory(type);
    }
    //获取其他分类
    @GetMapping("/other/category")
    public Object getOtherCategory(){
        int type=3;
        return categoryService.getBestCategory(type);
    }
}
